package teamGiga.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import teamGiga.dao.MovieDao;
import action.servlet.ActionForWard;

public class QnaInfoAction extends Action{
	private String path;
	private boolean redirect;
	public QnaInfoAction() {
		super();
	}
	public QnaInfoAction(String path, boolean redirect) {
		super();
		this.path = path;
		this.redirect = redirect;
	}
	@Override
	public ActionForWard execute(HttpServletRequest request,
			HttpServletResponse response) {
		// TODO Auto-generated method stub
		int no = Integer.parseInt(request.getParameter("no"));
		try {			
			MovieDao.selectQnaInfo(no);
			request.setAttribute("info", MovieDao.selectQnaInfo(no));
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}
		
		return new ActionForWard(path, redirect);
	}
	
}
